<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>LiftSimu: /Users/alrik/Documents/workspace/LiftSimu/src/EventHandler.java Quellcode</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="up.png"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">LiftSimu
   
   </div>
   <div id="projectbrief">die Simulation einer Liftanlage</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Erzeugt von Doxygen 1.8.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Suchen');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Hauptseite</span></a></li>
      <li><a href="annotated.html"><span>Klassen</span></a></li>
      <li class="current"><a href="files.html"><span>Dateien</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Suchen" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Auflistung&#160;der&#160;Dateien</span></a></li>
    </ul>
  </div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Alle</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Klassen</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Dateien</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Funktionen</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variablen</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">/Users/alrik/Documents/workspace/LiftSimu/src/EventHandler.java</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_event_handler_8java.html">gehe zur Dokumentation dieser Datei</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="keyword">import</span> java.awt.Color;
<a name="l00002"></a>00002 <span class="keyword">import</span> java.awt.Graphics2D;
<a name="l00003"></a>00003 <span class="keyword">import</span> java.awt.SplashScreen;
<a name="l00004"></a>00004 <span class="keyword">import</span> java.awt.event.*;
<a name="l00005"></a>00005 <span class="keyword">import</span> javax.swing.*;
<a name="l00006"></a>00006 <span class="keyword">import</span> javax.swing.event.ChangeEvent;
<a name="l00007"></a>00007 <span class="keyword">import</span> javax.swing.event.ChangeListener;
<a name="l00008"></a>00008 
<a name="l00028"></a><a class="code" href="class_event_handler.html">00028</a> <span class="keyword">public</span> <span class="keyword">class </span><a class="code" href="class_event_handler.html" title="die Klasse kümmert sich um die Ereignisse der GUI">EventHandler</a>{
<a name="l00029"></a><a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">00029</a>    <a class="code" href="class_simu_frame.html" title="Das Hauptfenster, mit der Simulation.">SimuFrame</a> <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>;
<a name="l00030"></a><a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">00030</a>    <a class="code" href="class_popup_frame.html" title="Popup um Personen von 0-14 einsteigen zu lassen.">PopupFrame</a> <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>;
<a name="l00031"></a><a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">00031</a>    <a class="code" href="class_lift.html" title="die Klasse der Liftsteuerung">Lift</a> <a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>;
<a name="l00032"></a><a class="code" href="class_event_handler.html#a0b94b43755bab05263019ff786f88880">00032</a>    <a class="code" href="class_trigger.html" title="Der Trigger für die EventQueue.">Trigger</a> <a class="code" href="class_event_handler.html#a0b94b43755bab05263019ff786f88880">trigger</a>;
<a name="l00033"></a>00033    
<a name="l00039"></a><a class="code" href="class_event_handler.html#a904cd7a4930808e5b25c3fc05fb74502">00039</a>    <span class="keyword">public</span> <a class="code" href="class_event_handler.html#a904cd7a4930808e5b25c3fc05fb74502" title="Konstruktor.">EventHandler</a>(){
<a name="l00040"></a>00040       <a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a> = <span class="keyword">new</span> <a class="code" href="class_lift.html" title="die Klasse der Liftsteuerung">Lift</a>();<span class="comment">//* Model</span>
<a name="l00041"></a>00041       <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a> = <span class="keyword">new</span> <a class="code" href="class_simu_frame.html" title="Das Hauptfenster, mit der Simulation.">SimuFrame</a>(<span class="stringliteral">&quot;LiftSimu &quot;</span> + <span class="stringliteral">&quot;v0.9.2&quot;</span>);<span class="comment">//* View erzeugen und öffnen</span>
<a name="l00042"></a>00042       <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a> = <span class="keyword">new</span> <a class="code" href="class_popup_frame.html" title="Popup um Personen von 0-14 einsteigen zu lassen.">PopupFrame</a>(); <span class="comment">//* View erzeugen aber nicht öffnen</span>
<a name="l00043"></a>00043       <a class="code" href="class_event_handler.html#a8241797db25891cc03e2ea07c504e47c" title="Weist allen GUI-Elementen ihr HandleEvent zu.">allocHandleEvents</a>();
<a name="l00044"></a>00044       
<a name="l00045"></a>00045 
<a name="l00046"></a>00046       <a class="code" href="class_event_handler.html#a0b94b43755bab05263019ff786f88880">trigger</a>= <span class="keyword">new</span> <a class="code" href="class_trigger.html" title="Der Trigger für die EventQueue.">Trigger</a>(<a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>, <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>);
<a name="l00047"></a>00047       <a class="code" href="class_event_handler.html#a0b94b43755bab05263019ff786f88880">trigger</a>.start();
<a name="l00048"></a>00048       
<a name="l00049"></a>00049       <a class="code" href="class_event_handler.html#aeb326fc730e8952f1690a60723660dc3" title="schließt das evtl. vorhandene Splashfenster beim Programmstart">closeSplash</a>(); <span class="comment">//* Beendet den Splashscreen</span>
<a name="l00050"></a>00050    }
<a name="l00051"></a>00051    
<a name="l00057"></a><a class="code" href="class_event_handler.html#a8241797db25891cc03e2ea07c504e47c">00057</a>    <span class="keyword">private</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler.html#a8241797db25891cc03e2ea07c504e47c" title="Weist allen GUI-Elementen ihr HandleEvent zu.">allocHandleEvents</a>(){
<a name="l00058"></a>00058       <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0; i&lt;9; i++){
<a name="l00059"></a>00059          <span class="comment">//Zuweisung für die Ruftasten</span>
<a name="l00060"></a>00060          <span class="keywordflow">if</span>(i&lt;8)
<a name="l00061"></a>00061          <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.<a class="code" href="class_simu_frame.html#ad7a19462c2fff84b4adae72e4dbe3754">levelpanels</a>[i].<a class="code" href="class_j_level_panel.html#aa5c944996def45c2c3394b9cdd24e821">Down</a>.addActionListener(<span class="keyword">new</span> <a class="code" href="class_event_handler_1_1_handle_call_b_pressed.html" title="erstellt das HandleEvent für die CallButtons">HandleCallBPressed</a>() );
<a name="l00062"></a>00062          <span class="keywordflow">if</span>(i&gt;0)
<a name="l00063"></a>00063          <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.<a class="code" href="class_simu_frame.html#ad7a19462c2fff84b4adae72e4dbe3754">levelpanels</a>[i].<a class="code" href="class_j_level_panel.html#a27b3686276d26f30b6ce798d13fa178a">Up</a>.addActionListener(<span class="keyword">new</span> <a class="code" href="class_event_handler_1_1_handle_call_b_pressed.html" title="erstellt das HandleEvent für die CallButtons">HandleCallBPressed</a>() );
<a name="l00064"></a>00064          <span class="comment">//Zuweisung für die Auswahltasten</span>
<a name="l00065"></a>00065          <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.<a class="code" href="class_simu_frame.html#a98d2003f4c9e4c15a67dd4551a157d9d">liftpanel</a>.<a class="code" href="class_j_lift_panel.html#a2a2d6efc0f3f59293f43b69b016b96ec">buttons</a>[i].addActionListener(<span class="keyword">new</span> <a class="code" href="class_event_handler_1_1_handle_choose_b_pressed.html" title="erstellt das HandleEvent für die ChooseButtons">HandleChooseBPressed</a>() );
<a name="l00066"></a>00066       }
<a name="l00067"></a>00067       <span class="comment">//Zuweisung des Okay-Buttons</span>
<a name="l00068"></a>00068       <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.<a class="code" href="class_popup_frame.html#ae7f28db1694fe9edc2504440babb45eb">bPopupOK</a>.addActionListener(<span class="keyword">new</span> <a class="code" href="class_event_handler_1_1_handle_o_k_b_pressed.html" title="erstellt das HandleEvent für den OK-Button">HandleOKBPressed</a>());
<a name="l00069"></a>00069       <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.<a class="code" href="class_popup_frame.html#a9b6610c6aafb63413236c31cc062b9db">bPopupCancel</a>.addActionListener(<span class="keyword">new</span> <a class="code" href="class_event_handler_1_1_handle_cancel_b_pressed.html" title="erstellt das HandleEvent für den Abbrechen-Button auf dem PopupFrame.">HandleCancelBPressed</a>());
<a name="l00070"></a>00070       <span class="comment">//Zuweisung des Spinner zu seinem Event</span>
<a name="l00071"></a>00071       <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.<a class="code" href="class_popup_frame.html#a76e4255b89ac17aca59624966ed17d03">sAnzahl</a>.addChangeListener(<span class="keyword">new</span> <a class="code" href="class_event_handler_1_1_spinner_listener.html" title="erstellt das HandleEvent für den ChangeListener">SpinnerListener</a>());
<a name="l00072"></a>00072       <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.<a class="code" href="class_simu_frame.html#a98d2003f4c9e4c15a67dd4551a157d9d">liftpanel</a>.<a class="code" href="class_j_lift_panel.html#ae43c9898c5610f671848bca279e8316c">Doorsclose</a>.addActionListener(<span class="keyword">new</span> <a class="code" href="class_event_handler_1_1_handle_doors_close_b_pressed.html" title="erstellt das HandleEvent für die Tür-Schließen-Buttons">HandleDoorsCloseBPressed</a>());
<a name="l00073"></a>00073       <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.<a class="code" href="class_simu_frame.html#a98d2003f4c9e4c15a67dd4551a157d9d">liftpanel</a>.<a class="code" href="class_j_lift_panel.html#a53481ac74221e366a9b20c28ec52ae10">Doorsopen</a>.addActionListener(<span class="keyword">new</span> <a class="code" href="class_event_handler_1_1_handle_doors_open_b_pressed.html" title="erstellt das HandleEvent für die Tür-Öffnen-Buttons">HandleDoorsOpenBPressed</a>());
<a name="l00074"></a>00074       <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.addWindowListener(<span class="keyword">new</span> <a class="code" href="class_event_handler_1_1_handle_popup_close.html" title="reagiert auf das schließen des PopupFrame über die OS-Funktion">HandlePopupClose</a>());
<a name="l00075"></a>00075    }
<a name="l00076"></a>00076 
<a name="l00082"></a><a class="code" href="class_event_handler.html#aeb326fc730e8952f1690a60723660dc3">00082</a>    <span class="keyword">private</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler.html#aeb326fc730e8952f1690a60723660dc3" title="schließt das evtl. vorhandene Splashfenster beim Programmstart">closeSplash</a>(){
<a name="l00083"></a>00083       <span class="keyword">final</span> SplashScreen splash = SplashScreen.getSplashScreen();
<a name="l00084"></a>00084       <span class="keywordflow">if</span> (splash == null) {
<a name="l00085"></a>00085          System.out.println(<span class="stringliteral">&quot;SplashScreen.getSplashScreen() returned null&quot;</span>);
<a name="l00086"></a>00086          <span class="keywordflow">return</span>;
<a name="l00087"></a>00087       }
<a name="l00088"></a>00088       Graphics2D g = splash.createGraphics();
<a name="l00089"></a>00089       <span class="keywordflow">if</span> (g == null) {
<a name="l00090"></a>00090          System.out.println(<span class="stringliteral">&quot;g is null&quot;</span>);
<a name="l00091"></a>00091          <span class="keywordflow">return</span>;
<a name="l00092"></a>00092       }
<a name="l00093"></a>00093    }
<a name="l00094"></a>00094    
<a name="l00101"></a><a class="code" href="class_event_handler_1_1_handle_call_b_pressed.html">00101</a>    <span class="keyword">class </span><a class="code" href="class_event_handler_1_1_handle_call_b_pressed.html" title="erstellt das HandleEvent für die CallButtons">HandleCallBPressed</a> <span class="keyword">implements</span> ActionListener{
<a name="l00102"></a>00102       
<a name="l00109"></a><a class="code" href="class_event_handler_1_1_handle_call_b_pressed.html#ae6cd5830cfa2d4127628522ea422a0a8">00109</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_call_b_pressed.html#ae6cd5830cfa2d4127628522ea422a0a8" title="die Aktion, die beim Drücken der Ruftaste ausgeführt wird">actionPerformed</a>(ActionEvent evt){
<a name="l00110"></a>00110          <span class="keywordtype">int</span> Fahrtwunsch=1;
<a name="l00111"></a>00111          System.out.println(<span class="stringliteral">&quot;eine Ruftaste wurde gedrückt&quot;</span>);
<a name="l00112"></a>00112          JButton pressed = (JButton)evt.getSource();
<a name="l00113"></a>00113          pressed.setBackground(Color.RED);
<a name="l00114"></a>00114          <span class="comment">//Feststellen welche Taste gedrückt wurde</span>
<a name="l00115"></a>00115          <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=1; i&lt;9; i++){
<a name="l00116"></a>00116             <span class="keywordflow">if</span> (<a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.<a class="code" href="class_simu_frame.html#ad7a19462c2fff84b4adae72e4dbe3754">levelpanels</a>[i-1].<a class="code" href="class_j_level_panel.html#aa5c944996def45c2c3394b9cdd24e821">Down</a>==pressed){
<a name="l00117"></a>00117                Fahrtwunsch=-(10-i);
<a name="l00118"></a>00118                <span class="keywordflow">break</span>;
<a name="l00119"></a>00119             }<span class="keywordflow">else</span>{
<a name="l00120"></a>00120                <span class="keywordflow">if</span> (<a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.<a class="code" href="class_simu_frame.html#ad7a19462c2fff84b4adae72e4dbe3754">levelpanels</a>[i-1].<a class="code" href="class_j_level_panel.html#a27b3686276d26f30b6ce798d13fa178a">Up</a>==pressed){
<a name="l00121"></a>00121                   Fahrtwunsch=10-i;
<a name="l00122"></a>00122                   <span class="keywordflow">break</span>;
<a name="l00123"></a>00123                }
<a name="l00124"></a>00124             }
<a name="l00125"></a>00125          }
<a name="l00126"></a>00126          <span class="comment">//der Liftanalage den Fahrtwunsch mitteilen</span>
<a name="l00127"></a>00127          <span class="keywordflow">if</span>(!<a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#a752adc2f4638138bc90f25e05500d92a" title="stellt fest ob die Fahrkabine noch (weiter) nach oben fahren muss.">setFahrtwunsch</a>(Fahrtwunsch))
<a name="l00128"></a>00128             pressed.setBackground(Color.white);
<a name="l00129"></a>00129       }
<a name="l00130"></a>00130    }
<a name="l00131"></a>00131    
<a name="l00138"></a><a class="code" href="class_event_handler_1_1_handle_choose_b_pressed.html">00138</a>    <span class="keyword">class </span><a class="code" href="class_event_handler_1_1_handle_choose_b_pressed.html" title="erstellt das HandleEvent für die ChooseButtons">HandleChooseBPressed</a> <span class="keyword">implements</span> ActionListener{
<a name="l00139"></a>00139       
<a name="l00146"></a><a class="code" href="class_event_handler_1_1_handle_choose_b_pressed.html#a9cad269193ce3511d7e380d45cb94504">00146</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_choose_b_pressed.html#a9cad269193ce3511d7e380d45cb94504" title="die Aktion, die beim Drücken der Wahltaste ausgeführt wird">actionPerformed</a>(ActionEvent evt){
<a name="l00147"></a>00147          
<a name="l00148"></a>00148          System.out.println(<span class="stringliteral">&quot;eine Wahltaste wurde gedrückt&quot;</span>);
<a name="l00149"></a>00149          JButton pressed = (JButton)evt.getSource();
<a name="l00150"></a>00150          <span class="keywordflow">if</span>(<a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#affdb5569975011b559998105148b7e06" title="gibt den Zustand der Türen zurück">getdoorcond</a>()&gt;0 &amp;&amp; <a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#afb3f3276a6600bb98b01c0ea8c990d61">doorcloseAction</a>==null &amp;&amp; <a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#a73ae93ec883441df2c4bbb4629eab66f">overloadAction</a>==null){ <span class="comment">//TODO könnte besser gemacht werden</span>
<a name="l00151"></a>00151             <span class="keywordtype">int</span> Etage=Integer.parseInt(pressed.getText());  <span class="comment">//nicht gerade besonders hübsch</span>
<a name="l00152"></a>00152             <span class="keywordflow">if</span>(Etage!=<a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#aa5edc87881e8ee3f661a42cdb2a6a7cd" title="gibt die aktuelle Etage zurück, in der sich die Kabine befindet.">getetage</a>()){
<a name="l00153"></a>00153                <a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#ad21c633f0d880b0c907700eb90222286" title="setzt das timeinterrupt-Flag zurück">settimeinterruptflag</a>(<span class="keyword">true</span>);
<a name="l00154"></a>00154                <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.<a class="code" href="class_popup_frame.html#a8680846e40695335c7d35c1c43627590" title="Der Konstruktor.">setEtage</a>(Etage);
<a name="l00155"></a>00155                <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.setEnabled(<span class="keyword">false</span>);
<a name="l00156"></a>00156                <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.setVisible(<span class="keyword">true</span>);
<a name="l00157"></a>00157             }
<a name="l00158"></a>00158          }
<a name="l00159"></a>00159       }
<a name="l00160"></a>00160    }
<a name="l00161"></a>00161    
<a name="l00168"></a><a class="code" href="class_event_handler_1_1_handle_o_k_b_pressed.html">00168</a>    <span class="keyword">class </span><a class="code" href="class_event_handler_1_1_handle_o_k_b_pressed.html" title="erstellt das HandleEvent für den OK-Button">HandleOKBPressed</a> <span class="keyword">implements</span> ActionListener{
<a name="l00169"></a>00169       
<a name="l00176"></a><a class="code" href="class_event_handler_1_1_handle_o_k_b_pressed.html#a843f7adbba6ffbc54e308c439085a2d6">00176</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_o_k_b_pressed.html#a843f7adbba6ffbc54e308c439085a2d6" title="die Aktion, die beim Drücken des OK-Buttons des PopupFrame ausgeführt wird">actionPerformed</a>(ActionEvent evt){
<a name="l00177"></a>00177          System.out.println(<span class="stringliteral">&quot;Der OK-Button wurde gedrückt&quot;</span>);
<a name="l00178"></a>00178          <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.setEnabled(<span class="keyword">true</span>);
<a name="l00179"></a>00179          <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.setVisible(<span class="keyword">false</span>);
<a name="l00180"></a>00180          <span class="comment">//Fenster wieder aktiv</span>
<a name="l00181"></a>00181          <span class="keywordtype">int</span> Carry=<a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#a927fe61421095dae7e4ee31755e494a9" title="verbucht die Personen die zusteigen">addPeopleandreturnCarry</a>(<a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.<a class="code" href="class_popup_frame.html#a136ff5fd225eed4f9b07ed6534aa0330" title="Der Konstruktor.">getEtage</a>(), <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.<a class="code" href="class_popup_frame.html#a045c975e0a8cd0971bc1efbc79c2bb32" title="Der Konstruktor.">getAnz</a>());
<a name="l00182"></a>00182          <span class="keywordflow">if</span>(Carry!=0){
<a name="l00183"></a>00183             <span class="comment">//Überlastroutine einleiten</span>
<a name="l00184"></a>00184             System.out.println(<span class="stringliteral">&quot;****ÜBERLAST*****&quot;</span>);
<a name="l00185"></a>00185             <a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#aecb9e4279248cfcfce3a00e0b5f54cdd" title="startet die Überlast-Routine">startoverloadroutine</a>(Carry);
<a name="l00186"></a>00186             <span class="comment">//viewHouse.toFront();</span>
<a name="l00187"></a>00187             <span class="comment">//viewPopup.setVisible(false);</span>
<a name="l00188"></a>00188          }<span class="keywordflow">else</span>{
<a name="l00189"></a>00189             <span class="comment">//keine Überlast</span>
<a name="l00190"></a>00190             
<a name="l00191"></a>00191             <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.<a class="code" href="class_simu_frame.html#a98d2003f4c9e4c15a67dd4551a157d9d">liftpanel</a>.<a class="code" href="class_j_lift_panel.html#a2a2d6efc0f3f59293f43b69b016b96ec">buttons</a>[<a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.<a class="code" href="class_popup_frame.html#a136ff5fd225eed4f9b07ed6534aa0330" title="Der Konstruktor.">getEtage</a>()-1].setBackground(Color.RED);
<a name="l00192"></a>00192             <a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#ad21c633f0d880b0c907700eb90222286" title="setzt das timeinterrupt-Flag zurück">settimeinterruptflag</a>(<span class="keyword">false</span>);
<a name="l00193"></a>00193          }
<a name="l00194"></a>00194       }
<a name="l00195"></a>00195    }
<a name="l00196"></a>00196    
<a name="l00203"></a><a class="code" href="class_event_handler_1_1_handle_cancel_b_pressed.html">00203</a>    <span class="keyword">class </span><a class="code" href="class_event_handler_1_1_handle_cancel_b_pressed.html" title="erstellt das HandleEvent für den Abbrechen-Button auf dem PopupFrame.">HandleCancelBPressed</a> <span class="keyword">implements</span> ActionListener{
<a name="l00204"></a>00204       
<a name="l00210"></a><a class="code" href="class_event_handler_1_1_handle_cancel_b_pressed.html#af6d28dc174a3636ac70a9c80d8c00884">00210</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_cancel_b_pressed.html#af6d28dc174a3636ac70a9c80d8c00884" title="die Aktion, die beim Drücken des Cancel-Buttons des PopupFrame ausgeführt wird">actionPerformed</a>(ActionEvent evt){
<a name="l00211"></a>00211          System.out.println(<span class="stringliteral">&quot;Der Cancel-Button wurde gedrückt&quot;</span>);
<a name="l00212"></a>00212          <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.setEnabled(<span class="keyword">true</span>);
<a name="l00213"></a>00213          <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.setVisible(<span class="keyword">false</span>);
<a name="l00214"></a>00214          <a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#ad21c633f0d880b0c907700eb90222286" title="setzt das timeinterrupt-Flag zurück">settimeinterruptflag</a>(<span class="keyword">false</span>);
<a name="l00215"></a>00215       }
<a name="l00216"></a>00216    }  
<a name="l00217"></a>00217    
<a name="l00224"></a><a class="code" href="class_event_handler_1_1_handle_popup_close.html">00224</a>    <span class="keyword">class </span><a class="code" href="class_event_handler_1_1_handle_popup_close.html" title="reagiert auf das schließen des PopupFrame über die OS-Funktion">HandlePopupClose</a> <span class="keyword">implements</span> WindowListener{
<a name="l00225"></a>00225       
<a name="l00231"></a><a class="code" href="class_event_handler_1_1_handle_popup_close.html#abbdd9b9604241e513fe3a4e32c9549fd">00231</a>        <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_popup_close.html#abbdd9b9604241e513fe3a4e32c9549fd" title="die Aktion, die beim Drücken des Schließbuttons-Buttons des PopupFrame ausgeführt wird...">windowClosing</a>(WindowEvent we){
<a name="l00232"></a>00232           <a class="code" href="class_event_handler.html#a050e654f276b488086a5e52c93f61dea">viewHouse</a>.setEnabled(<span class="keyword">true</span>);
<a name="l00233"></a>00233           <a class="code" href="class_event_handler.html#a1d79bd9b561094e1d993a828641a2e19">viewPopup</a>.setVisible(<span class="keyword">false</span>);
<a name="l00234"></a>00234           <a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#ad21c633f0d880b0c907700eb90222286" title="setzt das timeinterrupt-Flag zurück">settimeinterruptflag</a>(<span class="keyword">false</span>);
<a name="l00235"></a>00235        }
<a name="l00236"></a>00236 
<a name="l00237"></a>00237       <span class="comment">//Folgende Funktionen müssen aufgelistet werden, es findet aber keine Aktion statt</span>
<a name="l00238"></a>00238       <span class="comment">//Diese Funktionen müssen wir auflisten, damit wir das schließen-Event abfangen können. </span>
<a name="l00239"></a>00239       @Override
<a name="l00240"></a><a class="code" href="class_event_handler_1_1_handle_popup_close.html#ac5251d698f0be31fe352b2a354a217df">00240</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_popup_close.html#ac5251d698f0be31fe352b2a354a217df">windowActivated</a>(WindowEvent e) {
<a name="l00241"></a>00241          <span class="comment">// TODO Auto-generated method stub</span>
<a name="l00242"></a>00242          
<a name="l00243"></a>00243       }
<a name="l00244"></a>00244 
<a name="l00245"></a>00245       @Override
<a name="l00246"></a><a class="code" href="class_event_handler_1_1_handle_popup_close.html#a73b82c6477ed5baff8b589da2acf8e4b">00246</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_popup_close.html#a73b82c6477ed5baff8b589da2acf8e4b">windowClosed</a>(WindowEvent e) {
<a name="l00247"></a>00247          <span class="comment">// TODO Auto-generated method stub</span>
<a name="l00248"></a>00248          
<a name="l00249"></a>00249       }
<a name="l00250"></a>00250 
<a name="l00251"></a>00251       @Override
<a name="l00252"></a><a class="code" href="class_event_handler_1_1_handle_popup_close.html#af632500a306086b99dc7889ba612c318">00252</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_popup_close.html#af632500a306086b99dc7889ba612c318">windowDeactivated</a>(WindowEvent e) {
<a name="l00253"></a>00253          <span class="comment">// TODO Auto-generated method stub</span>
<a name="l00254"></a>00254          
<a name="l00255"></a>00255       }
<a name="l00256"></a>00256 
<a name="l00257"></a>00257       @Override
<a name="l00258"></a><a class="code" href="class_event_handler_1_1_handle_popup_close.html#ada54c1f5c702f360f8697187fc03ce4d">00258</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_popup_close.html#ada54c1f5c702f360f8697187fc03ce4d">windowDeiconified</a>(WindowEvent e) {
<a name="l00259"></a>00259          <span class="comment">// TODO Auto-generated method stub</span>
<a name="l00260"></a>00260          
<a name="l00261"></a>00261       }
<a name="l00262"></a>00262 
<a name="l00263"></a>00263       @Override
<a name="l00264"></a><a class="code" href="class_event_handler_1_1_handle_popup_close.html#a80995fd15cd81827651dbebf9e5d507e">00264</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_popup_close.html#a80995fd15cd81827651dbebf9e5d507e">windowIconified</a>(WindowEvent e) {
<a name="l00265"></a>00265          <span class="comment">// TODO Auto-generated method stub</span>
<a name="l00266"></a>00266          
<a name="l00267"></a>00267       }
<a name="l00268"></a>00268 
<a name="l00269"></a>00269       @Override
<a name="l00270"></a><a class="code" href="class_event_handler_1_1_handle_popup_close.html#a31343373c5d0390694db916379671dea">00270</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_popup_close.html#a31343373c5d0390694db916379671dea">windowOpened</a>(WindowEvent e) {
<a name="l00271"></a>00271          <span class="comment">// TODO Auto-generated method stub</span>
<a name="l00272"></a>00272          
<a name="l00273"></a>00273       }
<a name="l00274"></a>00274    }
<a name="l00275"></a>00275    
<a name="l00276"></a>00276    
<a name="l00283"></a><a class="code" href="class_event_handler_1_1_handle_doors_close_b_pressed.html">00283</a>    <span class="keyword">class </span><a class="code" href="class_event_handler_1_1_handle_doors_close_b_pressed.html" title="erstellt das HandleEvent für die Tür-Schließen-Buttons">HandleDoorsCloseBPressed</a> <span class="keyword">implements</span> ActionListener{
<a name="l00284"></a>00284       
<a name="l00292"></a><a class="code" href="class_event_handler_1_1_handle_doors_close_b_pressed.html#abdf9c2e9f43b7993b1deaaf9d40dd038">00292</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_doors_close_b_pressed.html#abdf9c2e9f43b7993b1deaaf9d40dd038" title="die Aktion, die beim Drücken des Türen-Schließen-Buttons ausgeführt wird">actionPerformed</a>(ActionEvent evt){
<a name="l00293"></a>00293          <span class="keywordflow">if</span>(<a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#abb9a1d776ddfc735d70e2c278dc3cea9" title="gibt die Anzahl aller Personen, die sich im Fahrstuhl befinden zurück">getAllPeople</a>()!=0) <span class="comment">//Die Türen werden nur geschlossen, wenn eine Person im Fahrstuhl ist.</span>
<a name="l00294"></a>00294             <a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#a687255d2bdce2ff161cf5130bd1ea579" title="leitet das schließen der Türen ein">closeDoors</a>();   
<a name="l00295"></a>00295          System.out.println(<span class="stringliteral">&quot;Der Türschließ-Button wurde gedrückt&quot;</span>);
<a name="l00296"></a>00296       }
<a name="l00297"></a>00297    }
<a name="l00298"></a>00298    
<a name="l00308"></a><a class="code" href="class_event_handler_1_1_handle_doors_open_b_pressed.html">00308</a>    <span class="keyword">class </span><a class="code" href="class_event_handler_1_1_handle_doors_open_b_pressed.html" title="erstellt das HandleEvent für die Tür-Öffnen-Buttons">HandleDoorsOpenBPressed</a> <span class="keyword">implements</span> ActionListener{
<a name="l00309"></a>00309       
<a name="l00315"></a><a class="code" href="class_event_handler_1_1_handle_doors_open_b_pressed.html#acbf7d902ed9aa106a985f9be848401c1">00315</a>       <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_handle_doors_open_b_pressed.html#acbf7d902ed9aa106a985f9be848401c1" title="die Aktion, die beim Drücken des Türen-Öffnen-Buttons ausgeführt wird">actionPerformed</a>(ActionEvent evt){
<a name="l00316"></a>00316          System.out.println(<span class="stringliteral">&quot;Der Türöffnen-Button wurde gedrückt&quot;</span>);
<a name="l00317"></a>00317          <span class="keywordflow">if</span>(<a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#abb9a1d776ddfc735d70e2c278dc3cea9" title="gibt die Anzahl aller Personen, die sich im Fahrstuhl befinden zurück">getAllPeople</a>()!=0)
<a name="l00318"></a>00318             <a class="code" href="class_event_handler.html#a3e9d4cdd91ebe377fe8bc043dee3ee41">lift</a>.<a class="code" href="class_lift.html#ae05401f4554e01bea9d1956b4d3fdf91" title="leitet das öffnen der Türen ein">openDoors</a>();
<a name="l00319"></a>00319       }
<a name="l00320"></a>00320    }
<a name="l00321"></a>00321    
<a name="l00322"></a>00322    
<a name="l00330"></a><a class="code" href="class_event_handler_1_1_spinner_listener.html">00330</a>    <span class="keyword">class </span><a class="code" href="class_event_handler_1_1_spinner_listener.html" title="erstellt das HandleEvent für den ChangeListener">SpinnerListener</a> <span class="keyword">implements</span> ChangeListener {
<a name="l00331"></a>00331       
<a name="l00337"></a><a class="code" href="class_event_handler_1_1_spinner_listener.html#ac7b1a9b1aa0e0228f63b800cc25579bd">00337</a>        <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code" href="class_event_handler_1_1_spinner_listener.html#ac7b1a9b1aa0e0228f63b800cc25579bd" title="die Aktion, die beim Ändern des Spinners ausgeführt wird">stateChanged</a>(ChangeEvent evt) {
<a name="l00338"></a>00338            System.out.println(<span class="stringliteral">&quot;Der Spinner wurde geändert&quot;</span>);
<a name="l00339"></a>00339            
<a name="l00340"></a>00340        }
<a name="l00341"></a>00341    }
<a name="l00342"></a>00342 }
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Erzeugt am Fre Jul 6 2012 16:05:55 für LiftSimu von &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.0
</small></address>

</body>
</html>
